class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) {
        unordered_map<int, int> um;
        for(int i = 0; i < nums.size(); i++)
        {
            unordered_map<int, int>::iterator iter = um.find(nums[i]);
            if(iter == um.end())
                um[target - nums[i]] = i;
            else
                return {um[nums[i]], i};
        }
    }
};
